package com.hspjava.Homework;

public class Homework03 {
    public static void main(String[] args) {
        String s = "Li Fu Min";
        printStr(s);
    }

    public static void printStr(String str) {
        if (str == null) {
            System.out.println("参数不能为null");
            return;
        }

        String[] s = str.split(" ");

        if ( s.length != 3 )  {
            System.out.println("输入格式有误");
            return ;
        }
        System.out.println(String.format("%s, %s.%c", s[2], s[0], s[1].charAt(0)));

    }
}
